import requests
'''
curl -X POST 'http://116.62.130.29/v1/files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'file=@localfile;type=image/[png|jpeg|jpg|webp|gif]' \
--form 'user=abc-123'

'''
import requests

url = 'http://116.62.130.29/v1/files/upload'
headers = {
    'Authorization': 'Bearer '  # Replace {api_key} with your actual API key
}
# file的形式是一个三元组(文件名,文件字节流，文件类型)
files = {
    'file': ('a.pdf', open('docs/01-GPT系列模型.pdf', 'rb'), 'application/pdf')  # Replace with actual file path and correct image type
}
data = {
    'user': 'abc-123'
}

response = requests.post(url, headers=headers, files=files, json=data)

print(response.status_code)
print(response.text)